<?php
namespace Api\Controller;
use Think\Controller;
class DoctorDetailsController extends Controller {
    public function getDoctorInfo(){
    	    $did=I('did');
          $uid=I('uid');
          $info=D('Doctor')->toIdGetDoctorInfo($did);
          $status=D('MyCollect')->follow($uid,$did);
          $Comment=D('Comment')->ToDidGetCommentInfo($did);
          $data['info']=$info;
          $data['follow']=$status;
          $data['comment']=$Comment;
          $data['commentnum']=count($Comment);
          EchoData($data);
    }
    //添加收藏
    public  function addCollect()
    {
        $add['uid']=I('uid');
        $add['did']=I('did');
        $addinfo=ad('my_collect',$add);
        $addinfostatus=$addinfo?1:0;
        EchoData($addinfostatus);
    }
    //删除收藏
    public function delCollect(){
        $del['uid']=I('uid');
        $del['did']=I('did');
        $addinfo=dt('my_collect',$del);
        $addinfostatus=$addinfo?1:0;
        EchoData($addinfostatus);
    }
}